CREATE TABLE [dbo].[TXMVTO_INTE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_CNTB_EMPR] [dbo].[TD_IN_001_CONT] NOT NULL,
[CO_UNID_CNTB] [dbo].[TD_VC_003] NOT NULL,
[CO_OPRC_CNTB] [dbo].[TD_VC_003] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANNO] NOT NULL CONSTRAINT [DF__TXMVTO_IN__NU_AN__55209ACA] DEFAULT (datepart(year,getdate())),
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[NU_ASTO] [dbo].[TD_VC_010] NOT NULL,
[NU_SECU] [dbo].[TD_IN_002] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL,
[FE_ASTO_CNTB] [dbo].[TD_DT_001] NOT NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020_CNTA] NOT NULL,
[TI_AUXI_EMPR] [dbo].[TD_VC_001] NULL,
[CO_AUXI_EMPR] [dbo].[TD_VC_020] NULL,
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[FE_DOCU] [dbo].[TD_DT_001] NULL,
[FE_DOCU_VENC] [dbo].[TD_DT_001] NULL,
[TI_CAMB] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[FA_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TXMVTO_IN__FA_CA__58F12BAE] DEFAULT ((1.000)),
[FA_CAMB_DIAR] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TXMVTO_IN__FA_CA__5AD97420] DEFAULT ((1.000)),
[TI_OPER] [dbo].[TD_VC_003] NOT NULL,
[IM_MVTO_ORIG] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TXMVTO_IN__IM_MV__5CC1BC92] DEFAULT ((0)),
[IM_MVTO_CNTB] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TXMVTO_IN__IM_MV__5EAA0504] DEFAULT ((0)),
[DE_GLOS] [dbo].[TD_VC_100] NOT NULL,
[TI_DOCU_REFE] [dbo].[TD_VC_003] NULL,
[NU_DOCU_REFE] [dbo].[TD_VC_020] NULL,
[FE_DOCU_REFE] [dbo].[TD_DT_001] NULL,
[NO_GIRA] [dbo].[TD_VC_050] NULL,
[FE_ENTR_CHEQ] [dbo].[TD_DT_001] NULL,
[FE_PROG_CHEQ] [dbo].[TD_DT_001] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[SI_MVTO_CNTB] [dbo].[TD_VC_003] NOT NULL,
[CO_UNID_ORIG] [dbo].[TD_VC_003] NULL,
[CO_OPRC_ORIG] [dbo].[TD_VC_003] NULL,
[NU_ASTO_ORIG] [dbo].[TD_VC_010] NULL,
[ST_OTRS] [dbo].[TD_VC_020] NULL,
[NU_PROC_SECU] [dbo].[TD_IN_001] NULL,
[ST_IMPR_CHEQ] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TXMVTO_IN__ST_IM__60924D76] DEFAULT ('N'),
[ST_FLAG] [dbo].[TD_VC_020] NULL,
[CO_TABL_ORIG] [dbo].[TD_IN_001] NULL,
[CO_CLAV_TAOR] [dbo].[TD_VC_100] NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[IM_MVTO_RETE] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TXMVTO_IN__IM_MV__627A95E8] DEFAULT ((0)),
[ST_IMPR_RETE] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TXMVTO_IN__ST_IM__6462DE5A] DEFAULT ('N'),
[ST_CANC_DOCU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TXMVTO_IN__ST_CA__664B26CC] DEFAULT ('N'),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TXMVTO_IN__FE_US__68336F3E] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__CO_CN__57FD0775] CHECK (([CO_CNTA_EMPR]>='0' AND [CO_CNTA_EMPR]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__FA_CA__59E54FE7] CHECK (([FA_CAMB]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__FA_CA__5BCD9859] CHECK (([FA_CAMB_DIAR]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__IM_MV__5DB5E0CB] CHECK (([IM_MVTO_ORIG]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__IM_MV__5F9E293D] CHECK (([IM_MVTO_CNTB]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__IM_MV__636EBA21] CHECK (([IM_MVTO_RETE]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__NU_AN__5614BF03] CHECK (([NU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__NU_CN__542C7691] CHECK (([NU_CNTB_EMPR]>=(1) AND [NU_CNTB_EMPR]<=(99)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__NU_ME__5708E33C] CHECK (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__ST_CA__673F4B05] CHECK (([ST_CANC_DOCU]='N' OR [ST_CANC_DOCU]='S'))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__ST_IM__618671AF] CHECK (([ST_IMPR_CHEQ]='N' OR [ST_IMPR_CHEQ]='S'))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [CK__TXMVTO_IN__ST_IM__65570293] CHECK (([ST_IMPR_RETE]='N' OR [ST_IMPR_RETE]='S'))
GO
ALTER TABLE [dbo].[TXMVTO_INTE] ADD CONSTRAINT [TXMVTO_INTE_6497693724] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_CNTB_EMPR], [CO_UNID_CNTB], [CO_OPRC_CNTB], [NU_ANNO], [NU_MESE], [NU_ASTO], [NU_SECU], [NU_PROC]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [I1XMVTO_INTE_01] ON [dbo].[TXMVTO_INTE] ([CO_EMPR], [NU_PROC]) ON [PRIMARY]
GO
